package com.group9.repository;

import com.group9.dto.PageInfo;
import com.group9.pojo.CommentResponse;
import com.group9.pojo.ResourceComment;
import org.springframework.data.mongodb.core.aggregation.ArrayOperators;

/**
 * Created by Lcouncillor on 2020/6/6.
 */
public interface CommentRepository {

    /**
     * 添加resourceComment实体类对象
     * @param resourceComment
     * @return
     */
    Integer insertResourceComment(ResourceComment resourceComment);

    /**
     * 添加commentResponse实体类对象
     * @param commentResponse
     * @return
     */
    Integer insertCommentResponse(CommentResponse commentResponse);

    /**
     * 通过一级评论id查找相应的一级评论
     * @param id
     * @return
     */
    ResourceComment selectResourceCommentById(String id);

    /**
     * 通过时间倒序以及分页查找一级评论
     * @param resourceId
     * @param pageInfo
     * @return
     */
    PageInfo selectByResourceIdAndPage(String resourceId, PageInfo pageInfo);

    /**
     * 为评论图片数组添加子元素
     * @param id
     * @param
     * @return
     */
    Integer updateCommentPic(String id, String commentPicUrl);

    /**
     * 二级评论查询
     * @param id
     * @return
     */
    CommentResponse selectCommentResponseById(String id);

}
